package com.ysu.yybk.controller;

import com.ysu.yybk.VO.old.OldResultVO;
import com.ysu.yybk.form.checkin.StudentCheckinGet;
import com.ysu.yybk.form.checkin.StudentSubmit;
import com.ysu.yybk.service.CheckinStudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/student/checkin")
public class CheckinStudentController {
    @Autowired
    CheckinStudentService checkinStudentService;

    @PostMapping("/get")
    public Map<String,Object> getCheckin(@RequestBody StudentCheckinGet student){

        return checkinStudentService.getInfo(student.getStudentId());
    }

    @PostMapping("/submit")
    public OldResultVO submit(@RequestBody StudentSubmit studentSubmit){
        return checkinStudentService.submit(studentSubmit);
    }
}
